//
//  EDSNavBarView.m
//  DrivieSchoolStudents
//
//  Created by TangBin on 2019/5/28.
//  Copyright © 2019 班文政. All rights reserved.
//

#import "EDSNavBarView.h"

@interface EDSNavBarView ()

@property (nonatomic, strong) UIButton *btnBack;


- (void)initWithBtnBack;

@end

@implementation EDSNavBarView

- (void)initWithVar
{
    [super initWithVar];
    
}

- (void)initWithSubView
{
    [super initWithSubView];
    
    [self initWithBtnBack];
}

- (void)initWithBtnBack
{
    if (!_btnBack)
    {
        int y = NAVBAR_HEIGHT_STATUS - 44 + (44 - 30) * 0.5;
        CGRect frame = CGRectMake(10, y, 30, 30);
        _btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
        [_btnBack setImage:[UIImage imageNamed:@"btn_nav_back_white"] forState:UIControlStateNormal];
        _btnBack.frame = frame;
        [_btnBack addTarget:self action:@selector(clickedBack:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_btnBack];
    }
}

- (void)clickedBack:(id)sender
{
    if (self.touchBackBlock)
    {
        self.touchBackBlock();
    }
}

@end
